/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

/* 布局样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

main {
    max-width: 1200px;
    margin: 0 auto;
}

/* 表单样式 */
.task-form {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.task-form h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

/* 任务控制区域 */
.task-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.task-controls h2 {
    color: #2c3e50;
}

.filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

.filter-btn.active {
    background-color: #3498db;
    color: white;
}

/* 任务容器 */
.tasks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* 任务卡片样式 */
.task-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.task-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.task-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.task-card p {
    margin-bottom: 15px;
    color: #7f8c8d;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
}

.priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.priority-high {
    background-color: #e74c3c;
    color: white;
}

.priority-medium {
    background-color: #f39c12;
    color: white;
}

.priority-low {
    background-color: #2ecc71;
    color: white;
}

.due-date {
    color: #7f8c8d;
}

.task-actions {
    display: flex;
    justify-content: space-between;
}

.complete-btn, .delete-btn {
    padding: 8px 12px;
    font-size: 14px;
}

.complete-btn {
    background-color: #2ecc71;
}

.complete-btn:hover {
    background-color: #27ae60;
}

.delete-btn {
    background-color: #e74c3c;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.task-card.completed {
    opacity: 0.7;
    border-left: 4px solid #2ecc71;
}

.task-card.completed h3 {
    text-decoration: line-through;
}

/* 空状态提示 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    color: #7f8c8d;
    font-size: 18px;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .task-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filters {
        width: 100%;
        justify-content: center;
    }
    
    .tasks-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .task-form, .task-card {
        padding: 15px;
    }
}